package site.wetsion.galio.sdk.handler;

import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * 默认无权限访问URL的处理
 *
 * @author wetsion
 * @version 1.0
 * @CLassName DefaultUrlDenyHandler
 * @date 2019/3/20 2:31 PM
 */
public class DefaultUrlDenyHandler implements UrlDenyHandler {
    @Override
    public void onDenied(ServletRequest request, ServletResponse response) throws IOException, ServletException {
        HttpServletResponse httpServletResponse = (HttpServletResponse) response;
        httpServletResponse.sendError(401, "don't have permission to access!");
    }
}
